<?php 
	get_header();
?>
		<div class="wrapper-content">
			<div class="wrapper-slideshow">
				<ul id="mycarousel" class="jcarousel-skin-believe">
					<?php $slideshow_home = new WP_Query( 'post_type=slideshow_home' ); ?>
					<?php if ( $slideshow_home->have_posts() ) : while ( $slideshow_home->have_posts() ) : $slideshow_home->the_post(); ?>
					<li><a href="<?php echo get ('link_externo'); ?>"><?php the_post_thumbnail( 'slideshow-single' ); ?></a></li>
					<?php endwhile; endif; ?>
				</ul>
			</div>
			<div class="content home">
				<ul class="destaque-home">
					<?php $destaques_home = new WP_Query( 'post_type=destaques_home' ); ?>
					<?php if ( $destaques_home->have_posts() ) : while ( $destaques_home->have_posts() ) : $destaques_home->the_post(); ?>
						<?php
							$tipo = get('tipo_de_destaque');
						?>
						<li class="<?php echo $tipo; ?>">
							<div class="wrapper-img"><a href="<?php echo get('link')?>"><?php if($tipo == 'simples'){ echo the_post_thumbnail('destaque-home-single');}else{echo the_post_thumbnail('destaque-home-double'); } ?></a></div>
							<h3><a href="<?php echo get('link')?>"><?php echo get_the_title(); ?></a></h3>
							<div class="texto-post">
								<p>
									<?php 
										$resumo = get_the_excerpt(); 
										 if($tipo == 'simples'){
											echo resumo($resumo, 100);
										}else{
											echo resumo($resumo, 300);
										}
									?>
								</p>
								<a href="<?php echo get('link')?>" class="saibamais">Saiba +</a>
								<span class="clear"></span>
							</div>
							<span class="clear"></span>
						</li>
					<?php endwhile; endif; ?>
					<span class="clear"></span>
				</ul>
				<span class="clear"></span>
				<ul class="posts-recentes">
					<h2><span>Posts Recentes</span></h2>
					<?php query_posts('posts_per_page=3'); if (have_posts()) : while (have_posts()) : the_post();?>
						<li>
							<div class="wrapper-img"><?php the_post_thumbnail( 'posts-recents' ); ?></div>
							<div class="wrapper-texto">
								<h3 class="categoria"><?php $category = get_the_category(); for ($i=0; $i < 3 ; $i++) { 
								 echo $category[$i]->cat_name . '   ' ; }  ?></h3>
								<h3 class="titulo"><?php echo get_the_title(); ?></h3>
								<p>
								<?php
									$conteudo = get_the_content();
									echo resumo($conteudo, 220);
								?>
								</p>
								<a href="<?php echo get_permalink(); ?>" class="saibamais">Saiba +</a>
								<span class="clear"></span>
							</div>
							<span class="clear"></span>
						</li>
						<span class="clear"></span>
					<?php endwhile; endif; ?>
					<span class="clear"></span>
				</ul>
				<span class="ver-todos"><a href="todos-posts">ver todos</a></span>
				<span class="clear"></span>
			</div>
			<div class="sidebar">
				<?php 
					get_sidebar(sidebar); 
				?>
			</div>
			<span class="clear"></span>
		</div><!--/wrapper-content-->
	</div><!--/container-->
<?php get_footer(); ?>